home *** CD-ROM | disk | FTP | other *** search
- /* GadTools layout toolkit
- **
- ** Copyright © 1993-1994 by Olaf `Olsen' Barthel
- ** Freely distributable.
- */
-
- #include "gtlayout_global.h"
-
- LONG LIBENT
- LT_LabelWidth(REG(a0) LayoutHandle *handle,REG(a1) STRPTR label)
- {
- if(handle)
- {
- LONG len;
- LONG cnt;
-
- cnt = 0;
- len = 0;
-
- while(label[len])
- {
- if(label[len] == '_')
- cnt += TextLength(&handle -> RPort,"_",1);
-
- len++;
- }
-
- return(TextLength(&handle -> RPort,label,len) - cnt);
- }
- else
- return(0);
- }
-
- LONG LIBENT
- LT_LabelChars(REG(a0) LayoutHandle *handle,REG(a1) STRPTR label)
- {
- if(handle)
- return((LT_LabelWidth(handle,label) + handle -> GlyphWidth - 1) / handle -> GlyphWidth);
- else
- return(0);
- }
-